package com.wswy.wzcx.ui.car.result

import android.arch.lifecycle.LiveData
import android.arch.lifecycle.MutableLiveData
import com.wswy.wzcx.api.Api
import com.wswy.wzcx.model.TrafficViolationInfo
import com.wswy.wzcx.module.base.BaseViewModel
import com.wswy.wzcx.module.base.Resource
import com.wswy.wzcx.module.base.onResult

class FinesViewModel : BaseViewModel() {

    private val fineHistoryLiveData = MutableLiveData<Resource <List<TrafficViolationInfo>> >()


    fun loadHistory(carNo:String){

        addRun(Api.get().getFineHistory(carNo).onResult(fineHistoryLiveData))

    }

    fun getFineHistoryLiveData():LiveData<Resource <List<TrafficViolationInfo>> > = fineHistoryLiveData

}